* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: sans-serif;
}

body {
  background-color: #faf8ef;
  color: #776e65;
  font-size: 18px;
}

.container {
  width: 500px;
  margin: auto;
}

.header {
  display: flex;
  margin-top: 10px;
  margin-bottom: 30px;
  justify-content: space-around;
  gap: 20px;
}

.game-title {
  font-size: 80px;
  margin-bottom: 10px;
}

.above-board {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}

.score-board {
  min-width: 120px;
  min-height: 50px;
  background-color: #bbada0;
  color: #faf8ef;
  border-radius: 3px;
  text-align: center;
  padding: 5px;
}

.score-title {
  margin-bottom: 5px;
  font-size: 16px;
  color: #eee4da;
}

.score-text {
  font-size: 25px;
  font-weight: bold;
}

.common-button {
  border: none;
  background-color: #8f7a66;
  color: #f9f6f2;
  font-size: 16px;
  border-radius: 3px;
  /* min-width: 80px; */
  padding: 10px 20px;
  cursor: pointer;
  white-space: nowrap;
}

.game-board {
  background-color: #bbada0;
  border-radius: 6px;
  /* padding: 15px; */
  margin-bottom: 50px;
  width: 500px;
  height: 500px;
  position: relative;
}

.grid-container {
  height: 100%;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 15px;
  padding: 15px;
  position: absolute;
  /* justify-content: stretch; */
  /* align-content: stretch; */
  /* align-items: stretch; */
  /* justify-items: stretch; */
}

.tips-container {
  position: absolute;
  visibility: hidden;
  height: 100%;
  width: 100%;
  z-index: 3;
}

.tips-common {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.5);
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.tips-win {
  visibility: hidden;
}

.tips-lose {
  visibility: hidden;
}

.tips-text {
  color: #f9f6f2;
  font-size: 60px;
  text-align: center;
  padding-bottom: 30px;
}

.button-list {
  display: flex;
  gap: 10px;
}

.button-continue {
  background-color: #f78e48;
}

/* .grid-row {
  height: 106.25px;
  margin-bottom: 15px;
} */

.grid-cell {
  /* height: 106.25px; */
  /* width: 106.25px; */
  height: 100%;
  width: 100%;
  border-radius: 6px;
  /* margin: 15px; */
  background: rgba(228, 238, 218, 0.35);
  position: relative;
}

.tile {
  background-color: #eee4da;
  border-radius: 6px;
  width: 100%;
  height: 100%;
  padding: 3%;
  font-size: 55px;
  font-weight: bold;

  display: flex;
  align-items: center;
  justify-content: center;

  position: absolute;
  z-index: 1;
}

.tile-100 {
  font-size: 50px;
}

.tile-1000 {
  font-size: 38px;
}

@keyframes appear {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* .tile {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background-color: #eee4da;
  text-align: center;
  font-size: 55px;
  font-weight: bold;
  line-height: 106.25px;
  transition: 100ms ease-in-out;
  transition-property: transform;
} */

.tile-moved {
  transition: 100ms ease-in-out;
  transition-property: transform;
}

.tile-merged {
  transform: scale(0);
  animation: pop 300ms ease 100ms forwards;
  z-index: 2;
}

.tile-new {
  opacity: 0;
  animation: appear 300ms ease 100ms forwards;
}

@media screen and (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .container {
    width: 320px;
    margin-top: 20px;
  }

  .game-title {
    font-size: 50px;
  }

  .game-board {
    width: 320px;
    height: 320px;
  }

  .score-board {
    min-width: 80px;
  }

  .score-title {
    font-size: 12px;
  }

  .score-text {
    font-size: 22px;
  }

  .common-button {
    font-size: 14px;
    padding: 8px 16px;
  }

  .grid-container {
    padding: 10px;
    gap: 10px;
  }

  .tile {
    font-size: 38px;
  }

  .tile-100 {
    font-size: 32px;
  }

  .tile-1000 {
    font-size: 22px;
  }
}
